// 引入接口
import {cateList} from '../../../request/api'
const state={
    cateList:[]
}

const getters ={
    getCateList(state){
        return state.cateList
    }
}

const mutations = {
    REQ_CATELIST(state,payload){
        state.cateList = payload
    }
}

const actions ={
    changeCateAction({commit}){
        cateList({
            istree:true
        })
        .then(res=>{
            console.log(res,'商品分类');
            commit('REQ_CATELIST',res.list)
        })
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    namespaced:true
}